﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HWR_Ants.Classes
{
    public class City
    {
        private readonly string ro_Name;
        private readonly Dictionary<City, Road> ro_Roads;

        public City(string name)
        {
            ro_Name = name;
            ro_Roads = new Dictionary<City, Road>();
        }

        public string Name
        {
            get { return ro_Name; }
        }

        public IEnumerable<City> NeighbourCitys
        {
            get { return ro_Roads.Keys; }
        }

        public Road Roads(City city)
        {
            Road ret = null;
            ro_Roads.TryGetValue(city, out ret);
            return ret;
        }

        internal void AddRoad(Road road, City other_City)
        {
            ro_Roads.Add(other_City, road);
        }
    }
}
